import request from '@/utils/request'

// 查询资金列表
export function listFund(query) {
  return request({
    url: '/system/fund/list',
    method: 'get',
    params: query
  })
}

// 查询资金详细
export function getFund(id) {
  return request({
    url: '/system/fund/' + id,
    method: 'get'
  })
}

// 新增资金
export function addFund(data) {
  return request({
    url: '/system/fund',
    method: 'post',
    data: data
  })
}

// 修改资金
export function updateFund(data) {
  return request({
    url: '/system/fund',
    method: 'put',
    data: data
  })
}

// 删除资金
export function delFund(id) {
  return request({
    url: '/system/fund/' + id,
    method: 'delete'
  })
}

// 获取项目资金详情
export function getFundInfo(query) {
  return request({
    url: '/system/fund/project/' + query.projectId + '/task/' + query.taskId,
    method: 'get'
  })
}

export function getProjectUsedFunding(projectId) {
  return request({
    url: '/system/fund/projectUsed/' + projectId,
    method: 'get'
  })
}
